package com.example.software.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.software.utils.PageUtils;
import com.example.software.utils.Query;

import com.example.software.dao.DiagnosisDao;
import com.example.software.entity.DiagnosisEntity;
import com.example.software.service.DiagnosisService;


@Service("diagnosisService")
public class DiagnosisServiceImpl extends ServiceImpl<DiagnosisDao, DiagnosisEntity> implements DiagnosisService {

    @Autowired
    private DiagnosisDao diagnosisDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<DiagnosisEntity> page = this.page(
                new Query<DiagnosisEntity>().getPage(params),
                new QueryWrapper<DiagnosisEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public DiagnosisEntity getByRecodeId(Integer recodeId) {
        return diagnosisDao.getByRecodeId(recodeId);
    }

}